package com.qf.pojo;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * @Description: 公用常量
 * @Data: 2022/9/14 10:13
 * @Pacakge: com.qf.pojo
 * @ClassName: Student
 * @Author: fan
 * 创建实体类
 */
@Data
//1.声明该类是jpa的实体类
@Entity
//2.该类与数据库那张表进行对应 通过name属性进行表的关联
@Table(name = "student")
public class Student {
    //声明主键
    @Id
    //表示设置为自增长组件
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    //表示将实体映射到数据库的列名中
    //属性name-->表示的是数据库列名
    @Column(name = "student_name")
    private String studentName;
    @Column(name = "student_password")
    private String password;
    @Column(name = "student_age")
    private Integer age;
    @Column(name = "student_birthday")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    @Column(name = "studnet_address")
    private String address;
    //表示jpa排除掉当前字段,不与数据库进行对应
    @Transient
    private String uid;

}
